﻿@model IEnumerable<HotelManageSystem.Models.ClientConsumptionInfoModel>

@{
    ViewBag.Title = "ClientConsumeShow";
    Layout = "~/Views/Shared/_Template3.cshtml";
}


@section Head{
    <link href="../../Content/TelerikGrid.css" rel="stylesheet" type="text/css" />
}
<div style="font-size: 26px;color: rgb(169, 0, 255)" align="center">
    <li>房间编号：@Session["roomId"].ToString()</li>
</div>
@{
    Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(key => key.Add(r => r.ProductID))
        
        .DataBinding(dataBind => dataBind.Ajax()
                                     .OperationMode(GridOperationMode.Client)
                                     .Select("TelerikAjax", "Client")
                                     .Update("UpdateConsumeInfo", "Client")
                                     .Delete("DeleteConsumeInfo", "Client")
        )

        .Pageable(page => page
                              .Style(GridPagerStyles.NextPreviousAndNumeric)
                              .Position(GridPagerPosition.Bottom)
                              .PageSize(10))
        .ToolBar(toolBar => toolBar.Template( @<text>
                                                   <label style="font-size: 16px" class="customer-label" for="Customers-input">
                                                       消费总价格: <strong>@TempData["SumAccount"]</strong> 元 
                                                       &nbsp;&nbsp;
                                                       消费时间： <strong>@ViewBag.ConsumeDate</strong> 
                                                   </label> 

                                               </text>))  
                                                  
                                             
        .Columns(columns =>
                     {
                         columns.Bound(r => r.ProductID).Title("ID").Width(20).HtmlAttributes(new {style = "text-align: center"}).Visible(false);
                         columns.Bound(r => r.ProductName).Title("客户名称").Width(60).HtmlAttributes(new { style = "text-align:center" }).ReadOnly(true);
                         columns.Bound(r => r.PriceOut).Title("单价").Width(30).HtmlAttributes(new { style = "text-align:center" }).ReadOnly(true).Format("{0:N2}");
                         columns.Bound(r => r.ProductCount).Title("数量").Width(20).HtmlAttributes(new { style = "text-align:center" });
                         columns.Bound(r => r.ProductCost).Title("小计").Width(30).HtmlAttributes(new { style = "text-align:center" }).ReadOnly(true);
                         columns.Command(commands =>
                                             {
                                                 commands.Edit().ButtonType(GridButtonType.ImageAndText); 
                                                 commands.Delete().ButtonType(GridButtonType.ImageAndText);
                                             }).Width(150).Title("操作");
                     }
                )
     .Editable(e=>e.Mode(GridEditMode.InLine))
     .Selectable()
     .Sortable()
     .Render();
    
   
}

